import request from '@/utils/request'
import {parseStrEmpty} from "../../utils/ruoyi";

// 查询开药列表
export function listResandmed(query) {
  return request({
    url: '/resandmed/resandmed/list',
    method: 'get',
    params: query
  })
}

// 查询开药详细
export function getResandmed(prescriptionId,drugsId) {
  return request({
    url: '/resandmed/resandmed/'+ parseStrEmpty(prescriptionId)+'/'+parseStrEmpty(drugsId),
    method: 'get'
  })
}

// 新增开药
export function addResandmed(data) {
  return request({
    url: '/resandmed/resandmed',
    method: 'post',
    data: data
  })
}

// 修改开药
export function updateResandmed(data) {
  return request({
    url: '/resandmed/resandmed',
    method: 'put',
    data: data
  })
}

// 删除开药
export function delResandmed(prescriptionId) {
  return request({
    url: '/resandmed/resandmed/' + prescriptionId,
    method: 'delete'
  })
}
